package com.srd.phone.bean;


import org.json.JSONException;
import org.json.JSONObject;

public class SucceedLoanDetail {

    public String nm;  /* 标名 */
    public String tidm; /* 借款标类型 */
    public double moneys;  /* 借款金额 */
    public double anyield;  /* 利率 */
    public double profit;   /* 借款利息 */
                            /* 第几期 */
    public String stime;  /* 还款时间 */
    public String numbersm;  /* 还款方式 */
                              /* 协议 */

    public static SucceedLoanDetail parseData(String json){

        SucceedLoanDetail detail = new SucceedLoanDetail();
        try {
            JSONObject jsonObj = new JSONObject(json);
            detail.nm = jsonObj.optString("nm");
            detail.tidm = jsonObj.optString("tidm");
            detail.moneys = jsonObj.optDouble("moneys",0);
            detail.anyield = jsonObj.optDouble("anyield",0);
            detail.profit = jsonObj.optDouble("profit",0);

            detail.stime = jsonObj.optString("stime");
            detail.numbersm = jsonObj.optString("numbersm");

        } catch (JSONException e) {
            e.printStackTrace();
        }

        return detail;
    }
}
